﻿@model IEnumerable<FashionShop.Models.Post>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table table-bordered table-hover">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Description)
        </th>

        <th>
            @Html.DisplayNameFor(model => model.Status)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.User.Username)
        </th>

        <th>
            @Html.DisplayNameFor(model => model.Created)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>

        <td>
            @Html.DisplayFor(modelItem => item.Status)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.User.Username)
        </td>

        <td>
            @Html.DisplayFor(modelItem => item.Created)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.PostID }) |
            @Html.ActionLink("Details", "Details", new { id=item.PostID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.PostID })
        </td>
    </tr>
}

</table>
